package cn.hr.entity;


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


/**
 * 项目实体类
 */
@Entity
@Table(name="tb_item"
    ,catalog="hrm"
)

public class Item  implements java.io.Serializable {


    // Fields    

     /**
	 * 
	 */
	private static final long serialVersionUID = -5093242183294133758L;
	private Integer id;
     private Company company;
     private String activityType;
     private String title;
     private String introduction;
     private Date startTime;
     private Date endTime;
     private Integer state;
     private String principal;
     private String contactWay;
     private String levels;
     private Integer points;
     private Set<ItemRecord> itemRecords = new HashSet<ItemRecord>(0);


    // Constructors

    /** default constructor */
    public Item() {
    }

	/** minimal constructor */
    public Item(Company company, String activityType, String title, String introduction, Date startTime, Date endTime, Integer state, String principal, String contactWay, String levels, Integer points) {
        this.company = company;
        this.activityType = activityType;
        this.title = title;
        this.introduction = introduction;
        this.startTime = startTime;
        this.endTime = endTime;
        this.state = state;
        this.principal = principal;
        this.contactWay = contactWay;
        this.levels = levels;
        this.points = points;
    }
    
    /** full constructor */
    public Item(Company company, String activityType, String title, String introduction, Date startTime, Date endTime, Integer state, String principal, String contactWay, String levels, Integer points, Set<ItemRecord> itemRecords) {
        this.company = company;
        this.activityType = activityType;
        this.title = title;
        this.introduction = introduction;
        this.startTime = startTime;
        this.endTime = endTime;
        this.state = state;
        this.principal = principal;
        this.contactWay = contactWay;
        this.levels = levels;
        this.points = points;
        this.itemRecords = itemRecords;
    }

   
    // Property accessors
    @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
	@ManyToOne(fetch=FetchType.LAZY)
        @JoinColumn(name="companyId", nullable=false)

    public Company getCompany() {
        return this.company;
    }
    
    public void setCompany(Company company) {
        this.company = company;
    }
    
    @Column(name="activityType", nullable=false, length=32)

    public String getActivityType() {
        return this.activityType;
    }
    
    public void setActivityType(String activityType) {
        this.activityType = activityType;
    }
    
    @Column(name="title", nullable=false, length=64)

    public String getTitle() {
        return this.title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    @Column(name="introduction", nullable=false, length=65535)

    public String getIntroduction() {
        return this.introduction;
    }
    
    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="startTime", nullable=false, length=0)

    public Date getStartTime() {
        return this.startTime;
    }
    
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="endTime", nullable=false, length=0)

    public Date getEndTime() {
        return this.endTime;
    }
    
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    
    @Column(name="state", nullable=false)

    public Integer getState() {
        return this.state;
    }
    
    public void setState(Integer state) {
        this.state = state;
    }
    
    @Column(name="principal", nullable=false, length=16)

    public String getPrincipal() {
        return this.principal;
    }
    
    public void setPrincipal(String principal) {
        this.principal = principal;
    }
    
    @Column(name="contactWay", nullable=false, length=32)

    public String getContactWay() {
        return this.contactWay;
    }
    
    public void setContactWay(String contactWay) {
        this.contactWay = contactWay;
    }
    
    @Column(name="levels", nullable=false, length=16)

    public String getLevels() {
        return this.levels;
    }
    
    public void setLevels(String levels) {
        this.levels = levels;
    }
    
    @Column(name="points", nullable=false)

    public Integer getPoints() {
        return this.points;
    }
    
    public void setPoints(Integer points) {
        this.points = points;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="item")

    public Set<ItemRecord> getItemRecords() {
        return this.itemRecords;
    }
    
    public void setItemRecords(Set<ItemRecord> itemRecords) {
        this.itemRecords = itemRecords;
    }
   








}